uarti2cspi2 2.2.0
Loading...
Searching...
No Matches
main.c File Reference

UART I2C SPI 2 Click example. More...

#include "board.h"
#include "log.h"
#include "uarti2cspi2.h"

Macros

#define DEMO_MESSAGE   "UART I2C/SPI 2 Click - demo message\r\n"

Functions

void application_init (void)
void application_task (void)
int main (void)

Detailed Description

UART I2C SPI 2 Click example.

Description

This example demonstrates the use of the UART I2C SPI 2 Click board. It sends a predefined demo message to both UART0 and UART1 interfaces, then reads back any received data and logs the results on the USB UART.

The demo application is composed of two sections :

Application Init

Initializes the logger and UART I2C SPI 2 Click, and applies the default configuration which sets the UART0 to 115200-8N1 and UART1 to 9600-8N1.

Application Task

Alternately selects UART0 and UART1, sends the demo message, reads back data from the RX FIFO, and logs the transmitted and received strings every second.

Note
Ensure that the connected devices on UART0 and UART1 are properly configured to communicate at the same baud rate and parameters.
Author
Stefan Filipovic

Macro Definition Documentation

◆ DEMO_MESSAGE

#define DEMO_MESSAGE   "UART I2C/SPI 2 Click - demo message\r\n"

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )